/*
package com.qf.air.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisCluster;
import redis.clients.jedis.JedisPool;

import java.util.HashSet;
import java.util.Set;

*/
/**
 * 封装和Redis的基本操作
 *//*

@Component
public class JedisUtil {

    @Autowired
    private JedisPool pool;
    // set
    public void set(String key,String value){
        Jedis jedis = null;
        try {
            jedis = pool.getResource();
            jedis.set(key,value);
        } finally {
            jedis.close();
        }
    }

    // get
    public String get(String key){
        Jedis jedis = null;
        try {
            jedis = pool.getResource();
            String value = jedis.get(key);
            return value;
        } finally {
            jedis.close();
        }
    }

    // expire
    public void expire(String key,int second){
        Jedis jedis = null;
        try {
            jedis = pool.getResource();
            jedis.expire(key,second);
        } finally {
            jedis.close();
        }
    }

    // setex
    public void setex(String key,int second,String value){
        Jedis jedis = null;
        try {
            jedis = pool.getResource();
            jedis.setex(key,second,value);
        } finally {
            jedis.close();
        }
    }

    // del
    public void del(String... key){
        Jedis jedis = null;
        try {
            jedis = pool.getResource();
            jedis.del(key);
        } finally {
            jedis.close();
        }
    }

}
*/
